﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.Web;

namespace EzDesk.Utility.Web.Extensions
{
    public static class UrlHelperExtension
    {

        public static string EzDeskReturnUrl(this UrlHelper url, string defaultFullUrl)
        {
            string returnUrl = HttpContext.Current.Request["returnUrl"];
            if (string.IsNullOrEmpty(returnUrl))
            {
                return defaultFullUrl;
            }
            else
            {
                return returnUrl;
            }
        }

        public static string EzDeskReturnUrl(this UrlHelper url, string appName, string defaultFuncUrl)
        {
            string returnUrl = HttpContext.Current.Request["returnUrl"];
            if (string.IsNullOrEmpty(returnUrl))
            {
                return defaultFuncUrl;
            }
            else
            {
                return returnUrl;
            }
        }
    }
}
